using System.Text.Json.Serialization;

namespace Eno.Application.Dto;

public class UserDto
{
    // 保证只有一个构造函数带有 [JsonConstructor]
    [JsonConstructor]
    public UserDto(
        Guid? id = null,
        string account = "",
        string password = "",
        string? defaultRole = "User",
        Guid? departmentId = null,
        bool isActived = true,
        bool isDeleted = false,
        string remarks = "",
        string avatar = "",
        string? displayName = null,
        string? email = null,
        string? phone = null
    )
    {
        ID = id;
        Account = account;
        Password = password;
        DefaultRole = defaultRole;
        DepartmentId = departmentId;
        IsActived = isActived;
        IsDeleted = isDeleted;
        Remarks = remarks;
        Avatar = avatar;
        DisplayName = displayName;
        Email = email;
        Phone = phone;
    }

    public Guid? ID { get; set; }
    public string Account { get; set; } = "";
    public string Password { get; set; } = "";
    public string? DefaultRole { get; set; } = "User";
    public Guid? DepartmentId { get; set; }
    public bool IsActived { get; set; } = true;
    public bool IsDeleted { get; set; } = false;
    public string Remarks { get; set; } = "";
    public string Avatar { get; set; } = "";
    public string? DisplayName { get; set; }
    public string? Email { get; set; }
    public string? Phone { get; set; }
}